<template>
<!-- 暂不开发 ，先屏蔽 -->
  <div class="tablePageWarp">
    <div class="commonTableSty">
      <s-table
        class="h100"
        ref="table"
        :columns="columns"
        :data="loadData"
        :scrollX="900"
        :rowKey="(record, index) => index"
        size="default" >
        <span slot="processModeDesc">
          {{ $t('auditWay') }}
          <question-mark-tip
            :tip-title="$t('processModeDesc')"
            :popupContainer="getPopupContainer"
          ></question-mark-tip>
        </span>
        <template slot="flowElementCode" slot-scope="text">
          <table-ellipsis :text="text || '-'"></table-ellipsis>
        </template>
        <template slot="flowElementName" slot-scope="text">
          <table-ellipsis :text="text || '-'"></table-ellipsis>
        </template>
        <template slot="approvalRole" slot-scope="text">
          <table-ellipsis :text="text || '-'"></table-ellipsis>
        </template>
        <template slot="approver" slot-scope="text">
          <table-ellipsis :text="text || '-'"></table-ellipsis>
        </template>
        <template slot="actualAssignee" slot-scope="text">
          <table-ellipsis :text="text || '-'"></table-ellipsis>
        </template>
        <!-- 操作结果 -->
        <template slot="operationResult" slot-scope="text">
          <table-ellipsis :text="$t(text === 1 ? 'opened' : 'closed')"></table-ellipsis>
        </template>
        <!-- 附件 -->
        <template slot="attachment" slot-scope="text,record">
          <a v-if="record.files" @click="showDownload(record.files)">{{ $t('download') }}</a>
          <span v-else>-</span>
        </template>
        <!-- 审核时间 -->
        <template slot="verifyTime" slot-scope="text">
          <table-ellipsis :text="$commonFun.getDateTimeStr(text) || '-'"></table-ellipsis>
        </template>
        <!-- 审核意见 -->
        <template slot="reviewComments" slot-scope="text">
          <table-ellipsis :text="text || '-'"></table-ellipsis>
        </template>
      </s-table>
    </div>
  </div>
</template>
<script>
import { STable } from '@/components'
import moment from 'moment'
import TableEllipsis from '@/components/Ellipsis/TableEllipsis'
import { viewflowDesignDetailNodeAttrColumns } from '@/views/components/AuditFlowProcess/config/list'

export default {
  components: {
    STable,
    TableEllipsis
  },
  computed: {},
  created () {
  },
  data () {
    return {
      moment,
      columns: viewflowDesignDetailNodeAttrColumns,
      tableData: []
    }
  },
  watch: {
  },
  methods: {
    getPopupContainer () {
      return document.querySelector('.ant-modal-wrap')
    },
    // // 刷新
    // refreshData (isToFirstPage = false) {
    //   const vm = this
    //   vm.$nextTick(() => {
    //     this.$refs.table.refresh(isToFirstPage)
    //   })
    // },
    // loadData (parameter) {
    //   const vm = this
    //   this.tableData = []
    //   const apiPromise = vm.$api.getVehicleVersionHistory({ ...parameter, vin: this.vin })
    //   return new Promise((resolve, reject) => {
    //     return apiPromise.then(res => {
    //       if (res.data) {
    //         this.tableData = res.data
    //       }
    //       resolve(res)
    //     }).catch(err => {
    //       reject(err)
    //     })
    //   })
    // }
  }
}
</script>
<style scoped lang="less">
</style>
